package com.example.imtoken.modules.main.my.address

import androidx.lifecycle.MutableLiveData
import com.example.imtoken.core.base.BaseViewModel
import com.example.imtoken.room.base.AppDataBase
import com.example.imtoken.room.schema.AddressBookSchema

class AddressViewModel : BaseViewModel() {

    private val addressBookLiveData = MutableLiveData<MutableList<AddressBookSchema>>()
    fun getAddressBook(): MutableLiveData<MutableList<AddressBookSchema>> {
        return addressBookLiveData
    }

    fun getAddressBookData() {
        val list = AppDataBase.instance.getAddressBookDao().findAllAddressBook()
        addressBookLiveData.value = list
    }

}